package com.ruoyi.oa.mapper;

import com.ruoyi.common.annotation.DataColumn;
import com.ruoyi.common.annotation.DataPermission;
import com.ruoyi.oa.domain.OaFinanceTripApply;
import com.ruoyi.oa.domain.bo.OaFinanceTripApplyBo;
import com.ruoyi.oa.domain.bo.OaPurchaseParityBo;
import com.ruoyi.oa.domain.vo.OaFinanceTripApplyVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.ruoyi.oa.domain.vo.OaHumanReplaceVo;
import com.ruoyi.oa.domain.vo.OaPurchaseParityVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 出差申请Mapper接口
 *
 * @author zhoul
 * @date 2023-03-28
 */
public interface OaFinanceTripApplyMapper extends BaseMapperPlus<OaFinanceTripApplyMapper, OaFinanceTripApply, OaFinanceTripApplyVo> {
    @DataPermission({
        @DataColumn(key = "deptName", value = "dept_id"),
        @DataColumn(key = "userName", value = "user_id")
    })
    List<OaFinanceTripApplyVo> queryByCondition(OaFinanceTripApplyBo bo);


    @Select("\tSELECT *\n" +
        "\tFROM oa_finance_trip_apply\n" +
        "\tWHERE create_time LIKE CONCAT( CONCAT( '%', #{month}), '%' )  and user_id=#{userId}")
    List<OaFinanceTripApplyVo> getUserTripByMonth(@Param("month") String month, @Param("userId") String userId);
}
